<?php
    include('checkAdminAccess.php');
    $iniVars = parse_ini_file('../../config.ini',TRUE);
    include('../classes/adodb5/adodb.inc.php');
    include('../function/db.func.php');
    
    $psid = $_POST['psid'];
    $sql = "SELECT ps_img FROM pride_student WHERE ps_id=$psid";
    $result = $db->Execute($sql);
    
    if(file_exists($iniVars['Locations']['sitepath'].$result->fields['ps_img'])){
        @unlink($iniVars['Locations']['sitepath'].$result->fields['ps_img']);
    }
    
    $sql = "DELETE FROM pride_student WHERE ps_id=$psid";
    $resultX = $db->Execute($sql);
    if($resultX)
    {
        echo 'success';
    }
?>